package cn.snowheart.ch01.configuration;

import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * 官方默认配置已调整为 FormLogin
 * 通过调整配置将其修正为 HttpBasic
 *
 * @author liuwanxiang
 * @version 2020/12/27
 */
@EnableWebSecurity
public class Ch01WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .anyRequest().authenticated()
                .and()
                .httpBasic();
    }
}
